import tkinter

window = tkinter.Tk()
window.title('植物大战僵尸修改器')
window.geometry('600x600')
# var = tkinter.StringVar()
# l = tkinter.Label(window, textvariable=var, bg='green', font=('Arial', 12), width=15, height=2)
# l.pack()
# on_hit = True
#
#
# def hit():
#     global on_hit
#     if on_hit:
#         var.set('you hit me')
#         on_hit = False
#     else:
#         var.set('')
#         on_hit = True

# b = tkinter.Button(window, text='hit me', width=15, height=2, command=hit)
# b.pack()


# e = tkinter.Entry(window, show=None)
# e.pack()
# t = tkinter.Text(window, height=2)
# t.pack()
#
#
# def insert1():
#     var = e.get()
#     t.insert('insert', var)
#
#
# def insert2():
#     var1 = e.get()
#     t.insert('end', var1)
#
#
# b = tkinter.Button(window, text='insert point', width=15, height=2, command=insert1)
# b.pack()
# b2 = tkinter.Button(window, text='insert end', width=15, height=2, command=insert2)
# b2.pack()


# var1 = tkinter.StringVar()
# var2 = tkinter.StringVar()
# var2.set((11, 22, 33, 44))
# l = tkinter.Label(window, bg='yellow', width=4, textvariable=var1)
# l.pack()
# lb = tkinter.Listbox(window, listvariable=var2, width=80)
# list_item = [1, 2, 3, 4]
# for i in list_item:
#     lb.insert('end', i)
# lb.insert(1, 'first')
# lb.insert(2, 'second')
# lb.delete(2)
# lb.pack()
#
#
# def selection():
#     var = lb.get(lb.curselection())
#     var1.set(var)
#
#
# b2 = tkinter.Button(window, text='print selection', width=15, height=2, command=selection)
# b2.pack()

var = tkinter.StringVar()
l = tkinter.Label(window, bg='yellow', font=('Arial', 12), width=24, height=2, text='empty')
l.pack()


def print_selection():
    l.config(text='you had chose ' + var.get())


rd1 = tkinter.Radiobutton(window, text='Option A', variable=var, value='A', command=print_selection,width=12,height=2)
rd1.pack()
rd2 = tkinter.Radiobutton(window, text='Option B', variable=var, value='B', command=print_selection,width=12,height=2)
rd2.pack()
rd3 = tkinter.Radiobutton(window, text='Option C', variable=var, value='C', command=print_selection,width=12,height=2)
rd3.pack()
window.mainloop()
